<? global $cat, $cat1, $cat2, $lg, $products, $FullUrl, $sales_off; ?>

<div class="main">
  <div class="main-body">
    <h2 style="color:#0000FF;"><?=$cat2['name_'.$lg]?></h2>
    <?
 $price_sales_per = 1;
			
if($sales_off != '')
{
	if($sales_off['value_vn']!='')
	{
		$price_sales_per = $sales_off['value_vn'];
	}
}
 ?>
<div class="shop-list-wrp">
      <div class="top-space"></div>
      <? if (count($products)>0 && $products != "") { ?>
      <? for ($i=0; $i<count($products); $i++) { 
	  		$pro = $products[$i];
			$img = GetImage($pro['img']);
			$link = GetProductLinkFull($pro, $lg);
			$pro_name = $pro["name_$lg"];
			$pro_desc = $pro["descs_$lg"];
			$pro_short = $pro["short_$lg"];
			$code = $pro["code"];
			$price = $pro["price"];
			$sales_off = $pro["sales_off"];
			$size = $pro["size"];
			$class_element = "list-item";
			
			
			//$class_element .= ($i != 0 && $i%4 == 0)?" marR0": "";
	  ?>
      <div class="<?=$class_element?>">
      <a href="<?=$link?>"> <h2><span> <?=$pro_name?></span> </h2></a>
        <div class="list-item-img"> <a href="<?=$link?>"> <img class="image" width="170" src="../../<?=$img?>" title="<?=$pro_name?>" alt="<?=$pro_name?>"> </a> </div>
        <ul class="list-item-content">
          
          <li class="product-code">  <a href="<?=$link?>"><span><?=($code!='')?$code:'Code [...]'?></span></a></li>
          <li class="product-price" style="text-decoration: line-through;">  <a href="<?=$link?>"><span style="color:#000">
            <?=($price!='')?number_format($price) .' VNĐ':'đang cập nhật giá'?>
            </span> </a></li>
            <li class="product-price">  <a href="<?=$link?>"><span style="color:#FF6600 !important">
            <?=($sales_off!='')?number_format($sales_off) .' VNĐ':($price!='')?number_format(round($price*(100-$price_sales_per)/100, -3)) .' VNĐ':'đang cập nhật giá'?>
            </span> </a></li>
        </ul>
        <?
        	if($pro['sales_off'] != '' && $pro['sales_off'] != '0')
			{
		?>
        <span class="saleoff_percent">-<?=$pro['sales_off']?>%</span>
        <?
			}
		?>
        <div class="clr"></div>
      </div>
      
      <?
		}
	  ?>
      <?
		}
	  ?>
    </div>
    <div class="clr"></div>
    
  </div>
</div>

